Scatter2D Chart

A scatterplot displays the relationship between 2 numeric variables. For each data point, the value of its first variable is represented on the X axis, the second on the Y axis.



Color Themes


{
   "binplotBins" : "30",
   "binplotShape" : "hexagon",
   "graphType" : "Scatter2D",
   "scatterType" : "bin2d",
   "showScatterDensity" : "true",
   "xAxis" : ["carat"],
   "yAxis" : ["price"]
}
library(canvasXpress)
y=read.table("https://www.canvasxpress.org/data/cX-dsmall-dat.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
z=read.table("https://www.canvasxpress.org/data/cX-dsmall-var.txt", header=TRUE, sep="\t", quote="", row.names=1, fill=TRUE, check.names=FALSE, stringsAsFactors=FALSE)
canvasXpress(
  data=y,
  varAnnot=z,
  binplotBins=30,
  binplotShape="hexagon",
  graphType="Scatter2D",
  scatterType="bin2d",
  showScatterDensity=TRUE,
  xAxis=list("carat"),
  yAxis=list("price")
)